package cn.sundat.web;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import cn.sundat.model.Dict;
import cn.sundat.service.DictService;
import cn.sundat.utils.FastJsonUtils;

public class DictAction extends ActionSupport{
	
	@Resource(name="dictService")
	private DictService dictService;
	
	/**
	 * 根据dict的type类型，去查找类型下的详细分类
	 * @return
	 */
	public String findItemByType() {
		//获取参数
		String s = "002";
		//调用service查询
	  List<Dict> list = dictService.findItemByType(s);
	  String jsonString = FastJsonUtils.toJsonString(list);
	  HttpServletResponse response = ServletActionContext.getResponse();
	  FastJsonUtils.write_json(response, jsonString);
	  
	  return NONE;
	}
}
